package com.mccken.springframework;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @program: mccken-collect
 * @description:
 * @author: mccken
 * @create: 2022-11-19 22:14
 **/
public class BeanFactory {
	
	private Map<String, BeanDefinition> beanDefinitionMap = new ConcurrentHashMap<>();
	
	 public Object getBean(String name) {
		 return beanDefinitionMap.get(name).getBean();
	 }
	 
	 public void registerBeanDefinition(String name, BeanDefinition beanDefinition) {
		 beanDefinitionMap.put(name, beanDefinition);
	 }
	
}
